/**
 * 
 */
package handwritten.grid;

import java.awt.Graphics2D;

import utility.math.Vector2D;



/**
 * @author tioz
 *
 */
public abstract class InputGrid {

	int textCellWidth, textCellHeight;
	int textUnderlineHeight;
	
	public InputGrid(int textCellWidth, int textCellHeight,int textUnderlineHeight) {
		
		this.textUnderlineHeight=textUnderlineHeight;
		this.textCellWidth = textCellWidth;
		this.textCellHeight = textCellHeight;

	}
	
	public int getTextCellWidth() {
		return textCellWidth;
	}

	public void setTextCellWidth(int textCellWidth) {
		this.textCellWidth = textCellWidth;
	}

	public int getTextCellHeight() {
		return textCellHeight;
	}

	public void setTextCellHeight(int textCellHeight) {
		this.textCellHeight = textCellHeight;
	}

	public abstract void paint(Graphics2D g);


	/**
	 * top left and bottom right corner coordinate of the input grid
	 * @param startX
	 * @param startY
	 * @param endX
	 * @param endY
	 */
	public abstract void update(int startX,int startY,int endX,int endY);
	

	
	/**
	 * @param pos
	 * @return the boundary of the cell in which is the point
	 */
	public abstract Vector2D[] getCellBoundary(Vector2D pos);
	
	
	public abstract Vector2D getCellTopLeft(Vector2D pos);
	
	/**
	 * return the real boundary of the Cell in which pos is inside
	 * @param pos
	 * @return
	 */
	public abstract int[] getCellNumber(Vector2D pos);
			
}
